package com.rocket.bedroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rocket.bedroom.dao.FloorDao;
import com.rocket.bedroom.pojo.FloorEntity;
import com.rocket.bedroom.service.IFloorService;
import com.rocket.bedroom.service.IRoomService;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import javax.annotation.Resource;

/**
 * @Author: 周毅
 * @ClassName:
 * @Description: TODO
 * @Date: Create in 10:54 2020/5/4
 * @ModifyBy:
 */
@Service
public class FloorServiceImpl extends ServiceImpl<FloorDao, FloorEntity> implements IFloorService {


    @Override
    public Integer hasFloorName(String floorName, Long blockId) {
        LambdaQueryWrapper<FloorEntity> lambdaQuery = Wrappers.lambdaQuery();
        lambdaQuery.eq(FloorEntity::getFloorName, floorName)
                .eq(FloorEntity::getBlockId, blockId);
        return super.count(lambdaQuery);
    }
}
